/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.eb.entity;

import com.kaaction.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import com.kaaction.common.persistence.DataEntity;

/**
 * 优惠券Entity
 * @author zengbiao
 * @version 2017-05-02
 */
public class Coupon extends DataEntity<Coupon> {
	
	private static final long serialVersionUID = 1L;
	private User user;		// user_id
	private String customerId;		// 领券人
	private String innerName;		// inner_name
	private String name;		// 优惠券名称
	private String type;		// 1=满100减50，2=打折，如0.83=满多少件，每件满足多少钱时，享受优惠
	private Double ruleRate;		// 打折比率
	private Double ruleFeeToal;		// 满100费用时，减免10元费用。则填100
	private Double ruleFeeSub;		// 满100费用时，减免10元费用。则填10
	private Integer ruleQuantityTotal;		// 满多少件，享受优惠
	private Double ruleQuantityPerCellFee;		// 按数量计算规则时，每件的基本价格要求
	private Integer totalNum;		// total_num
	private Integer remainNum;		// remain_num
	private String cover;
	
	public Coupon() {
		super();
	}

	public Coupon(String id){
		super(id);
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=0, max=64, message="领券人长度必须介于 0 和 64 之间")
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
	@Length(min=0, max=500, message="inner_name长度必须介于 0 和 500 之间")
	public String getInnerName() {
		return innerName;
	}

	public void setInnerName(String innerName) {
		this.innerName = innerName;
	}
	
	@Length(min=1, max=500, message="优惠券名称长度必须介于 1 和 500 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=1, message="满多少件，每件满足多少钱时，享受优惠长度必须介于 0 和 1 之间")
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public Double getRuleRate() {
		return ruleRate;
	}

	public void setRuleRate(Double ruleRate) {
		this.ruleRate = ruleRate;
	}
	
	public Double getRuleFeeToal() {
		return ruleFeeToal;
	}

	public void setRuleFeeToal(Double ruleFeeToal) {
		this.ruleFeeToal = ruleFeeToal;
	}
	
	public Double getRuleFeeSub() {
		return ruleFeeSub;
	}

	public void setRuleFeeSub(Double ruleFeeSub) {
		this.ruleFeeSub = ruleFeeSub;
	}
	
	public Integer getRuleQuantityTotal() {
		return ruleQuantityTotal;
	}

	public void setRuleQuantityTotal(Integer ruleQuantityTotal) {
		this.ruleQuantityTotal = ruleQuantityTotal;
	}
	
	public Double getRuleQuantityPerCellFee() {
		return ruleQuantityPerCellFee;
	}

	public void setRuleQuantityPerCellFee(Double ruleQuantityPerCellFee) {
		this.ruleQuantityPerCellFee = ruleQuantityPerCellFee;
	}
	
	public Integer getTotalNum() {
		return totalNum;
	}

	public void setTotalNum(Integer totalNum) {
		this.totalNum = totalNum;
	}
	
	public Integer getRemainNum() {
		return remainNum;
	}

	public void setRemainNum(Integer remainNum) {
		this.remainNum = remainNum;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}
	
}